﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Deeper.Engine
{
	public class TextNode : IElement
	{
		public TextNode(string text)
		{
			this.Text = text;
		}

		/// <summary>
		/// 此节点的文本数据
		/// </summary>
		public string Text { get; protected set; }

		/// <summary>
		/// 呈现本元素的数据
		/// </summary>
		/// <param name="writer"></param>
		public void Render(System.IO.TextWriter writer)
		{
			writer.Write(this.Text);
		}

		/// <summary>
		/// 返回文本节点的文本字符
		/// </summary>
		/// <returns></returns>
		public override string ToString()
		{
			return this.Text;
		}
	}
}
